Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LizandroCanul/back_sdo/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Update user account information. Users can update their own profile, and admins can update any user. When the password is changed, it’s automatically re-encrypted andmustChangePassword is set to false.
Authentication
Requires a valid JWT token. The authenticated user must be either:- An admin (can update any user)
- The owner of the account (can only update their own profile)
Path Parameters
The unique identifier of the user to update
Request Body
All fields are optional. Only include fields you want to update.User’s full name. Minimum 3 characters if provided.
User’s email address. Must be valid email format and unique.
New password. Minimum 6 characters. Will be encrypted and sets
mustChangePassword to false.User role. Must be either
admin or user.Whether the user account is active.
Flag to force password change on next login.
Response
Returns the updated user object (password field is excluded).User’s unique identifier
User’s email address
User’s full name
User role:
admin or userAccount active status
Password change requirement flag
Timestamp when the user was created
Timestamp when the user was last updated
Example Requests
Update Profile
Change Password
Example Response
200 Success
400 Bad Request
403 Forbidden
404 Not Found
Authorization Rules
The endpoint validates permissions as follows:- Admin users: Can update any user’s information
- Regular users: Can only update their own profile (user.userId === id)
- Mismatch: If a regular user tries to update another user, returns 403 Forbidden
/home/daytona/workspace/source/src/users/users.controller.ts:58
Special Behaviors
Password Update
When a password is provided:- It’s hashed using bcrypt with 10 salt rounds
mustChangePasswordis automatically set tofalse- The password field is never returned in the response